package models

type Topic struct {
    ID        string `json:"id"`
    Name      string `json:"name"`
    CreatedAt int64  `json:"createdAt"`
}

type Message struct {
    ID        string `json:"id"`
    TopicID   string `json:"topicId"`
    Role      string `json:"role"`      // "user" or "assistant"
    Content   string `json:"content"`
    Username  string `json:"username"`  // Sender username
    Mine      bool   `json:"mine"`      // Is sent by current user
    Timestamp int64  `json:"timestamp"`
    CreatedAt int64  `json:"createdAt"`
}

type SystemStatus struct {
    CPU     CPUInfo     `json:"cpu"`
    Memory  MemoryInfo  `json:"memory"`
    Disk    DiskInfo    `json:"disk"`
    Network NetworkInfo `json:"network"`
    Uptime  float64     `json:"uptime"`
}

type CPUInfo struct {
	Usage float64 `json:"usage"`
	Cores int     `json:"cores"`
	Model string  `json:"model"`
}

type MemoryInfo struct {
    Total        uint64        `json:"total"`
    Used         uint64        `json:"used"`
    Available    uint64        `json:"available"`
    Usage        float64       `json:"usage"`
    TopProcesses []ProcessInfo `json:"topProcesses"`
}

type ProcessInfo struct {
    Name   string  `json:"name"`
    PID    string  `json:"pid"`
    Memory string  `json:"memory"`
    Usage  float64 `json:"usage"`
}

type DiskInfo struct {
    Total     uint64  `json:"total"`
    Used      uint64  `json:"used"`
    Available uint64  `json:"available"`
    Usage     float64 `json:"usage"`
}

type NetworkInfo struct {
    Connections int    `json:"connections"`
    Status      string `json:"status"`
}

// EncryptedKey storage structure
type EncryptedKey struct {
    ID          string `json:"id"`
    EncryptedKey string `json:"encrypted_key"`
    Salt        string `json:"salt"`
    CreatedAt   int64  `json:"created_at"`
    UpdatedAt   int64  `json:"updated_at"`
}
